package com.qf.springcloud.filters;

import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;
import org.springframework.stereotype.Component;

@Component
public class MyPreFilter04 extends ZuulFilter {
    @Override
    public String filterType() {
        return "pre";
    }

    @Override
    public int filterOrder() {
        return 90;
    }

    @Override
    public boolean shouldFilter() {
        RequestContext requestContext=RequestContext.getCurrentContext();
        boolean zuulResponse = requestContext.sendZuulResponse();
        return zuulResponse;
    }

    @Override
    public Object run() throws ZuulException {
        System.err.println("MyPreFilter04");
        return null;
    }
}
